package org.akomantoso.core.io.util.group;

import java.util.IdentityHashMap;
import java.util.Map;

import org.akomantoso.core.data.Answer;
import org.akomantoso.core.data.Narrative;
import org.akomantoso.core.data.Question;
import org.akomantoso.core.data.Scene;
import org.akomantoso.core.data.Speech;
import org.akomantoso.core.data.Summary;
import org.akomantoso.core.data.group.ANcontainers;
import org.akomantoso.core.io.util.Instantiator;

/**
 * @author <a href="mailto:jacques.militello@gmail.com">Jacques Militello</a>
 */
public final class ANcontainersGroup {

	private ANcontainersGroup() {
	}

	public static final Map<String, Instantiator<ANcontainers>> MAP;

	static {

		Map<String, Instantiator<ANcontainers>> temp = new IdentityHashMap<String, Instantiator<ANcontainers>>();

		// narrative
		temp.put(Narrative.ELEMENT, new Instantiator<ANcontainers>() {
			public Narrative instantiate() {
				return new Narrative();
			}
		});

		// speech
		temp.put(Speech.ELEMENT, new Instantiator<ANcontainers>() {
			public Speech instantiate() {
				return new Speech();
			}
		});

		// summary
		temp.put(Summary.ELEMENT, new Instantiator<ANcontainers>() {
			public Summary instantiate() {
				return new Summary();
			}
		});

		// scene
		temp.put(Scene.ELEMENT, new Instantiator<ANcontainers>() {
			public Scene instantiate() {
				return new Scene();
			}
		});

		// question
		temp.put(Question.ELEMENT, new Instantiator<ANcontainers>() {
			public Question instantiate() {
				return new Question();
			}
		});

		// answer
		temp.put(Answer.ELEMENT, new Instantiator<ANcontainers>() {
			public Answer instantiate() {
				return new Answer();
			}
		});

		MAP = temp;
	}
	
}